import { AxiosAccount } from '../utils/http/request';
import { LoginForm } from '../interface/index';

enum Api {
  login = '/auth/login',
  logout = '/auth/logout',
}
//上传附件
export const upload = '/file/upload/image';
export const uploadVideo = '/file/upload/video';

// 登录
export const Login = (data: LoginForm) =>
  AxiosAccount.request({
    url: Api.login,
    method: 'post',
    data,
  });
// 登出
export const Logout = () =>
  AxiosAccount.request({
    url: Api.logout,
    method: 'post',
  });

//上传图片
export const uploadAxios = (data: any) =>
  AxiosAccount.request({
    url: upload,
    method: 'post',
    data,
  });
//上传视频
export const uploadAxiosVideo = (data: any) =>
  AxiosAccount.request({
    url: uploadVideo,
    method: 'post',
    data,
  });
